// 该文件专门用于创建整个应用的路由器
import VueRouter from 'vue-router'
//引入组件
import Index from '@/pages/Index'
import LocationSearch from "@/components/LocationSearch";
import Visualization from "@/components/Visualization";
import Navigation from "@/components/Navigation";
import Retrieve from "@/components/Retrieve";


//创建并暴露一个路由器
const router = new VueRouter({
    mode: "history",
    routes: [
        {
            path: '/index',
            redirect: '/'
        },
        {
            path: '/',
            component: Index,
            children: [
                {
                    path: '',
                    component: LocationSearch,
                },
                {
                    path: 'navigation',
                    component: Navigation,
                },
                {
                    path: 'retrieve',
                    component: Retrieve,
                },
                {
                    path: 'visualization',
                    component: Visualization,
                },
            ]
        },
        {
            path: '*',
            redirect: '/'
        }
    ]
})

export default router
